package com.WJY.controller;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class R {

    private Integer code ;
    private String msg;
    private Object data;

    public R(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public R(Integer code, Object data) {
        this.code = code;
        this.data = data;
    }

    public static R success(int code,Object data){
        return new R(code,data);
    }
    public static R success(int code,String msg){
        return new R(code,msg);
    }

    public static R failure(int code,String msg){
        return new R(code,msg);
    }

}
